#ifndef PRE_PROC
#define PRE_PROC
#include "define.h"
#include "..\lib\ICTCLAS\WordSegment.h"
#define MAX_LEN 100
void copyFiles(CString dir,int docNum);
void makeWorkDirs(CString rootDir,bool clearTrain=false,bool clearTest=false);
void substr(char * src,char* dest,int start,int len);
class CWordCountMapContainer
{
public:
    CWordCountMapContainer(int num);
    CWordCountMapContainer();
    bool updateValue(CString &name,int classId);
	bool updateValue(char *name,int classId);
    void setNum(int num);
    int getNum();
public:
    wordCountMap m_wCMap;
private:
    int m_num;
};
class CPreProcessor
{
public:
	CPreProcessor(){}
	bool init(CString dir,NTAG	tag);
	bool preProcessTrain(const CString& trainDir);
	bool preProcessTest(const CString& testDir);
	bool preIndexTrain();
private:
	bool preProcess(CString inputFilePath,
		            CString resultDir,CString keyWord);
	bool preIndex(CString& inputDir,CString keyword);
	bool wordSeg(CString &targetFileName,CString &stopFileName,
				 CString& hybridFileName,CString &fisherFileName);
	bool isTrivial(CString name,CString pos);
	bool isHybridFeature(CString pos);
	bool isDesiredPattern(CString prePos,CString curPos);
	bool initFeatureList();
	bool initPatternList();
private:
	CString m_dir;
	NTAG	m_tag;
	CWordSegment m_wordSegment;
	std::vector<CString> m_stopWords;

};
#endif